Problem Link: LeetCode 206. Reverse Linked List
class Solution { public ListNode reverseList(ListNode head) { ListNode prev = null; ListNode cur = head; while(cur != null){ ListNode temp = cur.next; cur.next = prev; prev = cur; cur = temp; } return prev; } }